<script type="text/html" template lay-done="layui.data.sendParams(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserTocash-editForm" id="LAY-app-CoreCmsUserTocash-editForm">
        <input type="hidden" name="id" value="{{d.params.data.model.id }}" />

        <div class="layui-form-item">
            <label for="type" class="layui-form-label  layui-form-required">提现方式</label>
            <div class="layui-input-block">
                <select name="type" lay-verify="required|number" lay-reqText="请选择提现方式" lay-filter="selectType">
                    <option value="">请选择提现方式</option>
                    {{# layui.each(indexData.userTocashType, function(index, item){ }}
                    <option value="{{ item.value }}">{{ item.title }}</option>
                    {{# }); }}
                </select>
            </div>
        </div>
        <div class="layui-form-item" id="selectStatusBox">
            <label for="type" class="layui-form-label  layui-form-required">审核状态</label>
            <div class="layui-input-block">
                <select name="status" lay-verify="required|number" lay-reqText="请选择审核状态">
                    {{# layui.each(indexData.userTocashStatus, function(index, item){ }}
                    <option value="{{ item.value }}" {{item.value===d.params.data.model.status?'selected="selected"':''}}>{{ item.title }}</option>
                    {{# }); }}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-mid">
                注：<br />
                1、微信提现需微信支付商户开通了企业付款到零钱功能。<br />
                2、只有【提现方式】为【银行卡】，才可主动设置成功失败。<br />
                3、微信提现方式下，将依据请求微信api接口返回信息，进行状态处理。<br />
                4、【微信提现付款到零钱】【微信提现付款到银行卡】再有异常的情况下，都可继续进行新的处理，可能会存在网络，微信支付商户余额，用户填写的银行卡信息错误等。<br />
                5、【微信提现付款到银行卡】需要配置【RsaPublicKey】，请自行添加，不然会报异常。
            </div>
        </div>

        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserTocash-editForm-submit" id="LAY-app-CoreCmsUserTocash-editForm-submit" value="确认提现">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;

                $('#selectStatusBox').hide();

                form.on('select(selectType)', function (data) {
                    console.log(data.value); //复选框value值，也可以通过data.elem.value得到
                    if (data.value === '0') {
                        $('#selectStatusBox').show();
                    } else {
                        $('#selectStatusBox').hide();
                    }
                });



                //重载form
                form.render(null, 'LAY-app-CoreCmsUserTocash-editForm');
            })
    };
</script>
